<!DOCTYPE html>
<html>
 <meta charset='utf-8'/>
<script>
var a=prompt("请输入出生年份:");
var b=2020
alert("年龄："+(b-a));
</script>
</html>